<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?
/*****************************************************************************
 * 文件名：Options.php
 * 作用：Options控制器类 负责记录整个系统的配置信息
 * 创建时间：2010.1.20
 * 作者：赵鹏城
 * ****************************************************************************/
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系统配置</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>

<a href="<?php echo url('Home');?>" target="_self" class="Dig"><strong>HOME</strong></a>
<form action="<?php echo url('Options', 'AddOption');?>" method="post" enctype="application/x-www-form-urlencoded" name="add_option">
<table width="80%" border="0" align="center">
<tr>
  <td width="23%" height="24" bgcolor="#DFDFDF">
  <label>option_name
    <input type="text" name="option_name" id="option_name" />
  </label>
  </td>
  <td width="23%" height="24" bgcolor="#DFDFDF">
  <label>option_value
    <input type="text" name="option_value" id="option_value" />
  </label>
  </td>
  <td width="54%" height="24" bgcolor="#DFDFDF">
  <label>add_option
    <input type="submit" name="add_option" id="add_option" value="提交" />
  </label>
  </td>
</tr>
</table>
</form>
<p>&nbsp;</p>

<form action="<?php echo url('Options');?>" method="post" enctype="application/x-www-form-urlencoded" name="update_all">
<table width="80%" border="0" align="center">
<tr>
<td width="10%" height="24" bgcolor="#DFDFDF">编号</td>
<td width="10%" bgcolor="#DFDFDF">选项名</td>
<td width="10%" bgcolor="#DFDFDF">选项值</td>
<td width="10%" bgcolor="#DFDFDF">自动加载</td>
<td width="10%" bgcolor="#DFDFDF">操作</td>
</tr>
<?php
		foreach ($rowset as $row)
		{
			$extra = "";
			$check = "";
			if($row['autoload'])$check = "checked=\"checked\"";
$delete_url = url('Options', 'DeleteOption', array('option_id' => $row['option_id']));
print<<<eot
<tr>
<td height="24" bgcolor="#F3F3F3">{$row['option_id']}&nbsp;{$extra}</td>
<td height="24" bgcolor="#F3F3F3">
<label>
<input size="32" type="text" name="option_name{$row['option_id']}" value="{$row['option_name']}"/>
</label>
</td>
<td height="24" bgcolor="#F3F3F3">
<label>
<input size="80" type="text" name="option_value{$row['option_id']}" value="{$row['option_value']}"/>
</label>
</td>
<td height="24" bgcolor="#F3F3F3"><input type="checkbox" name="autoload{$row['option_id']}" value="1" {$check}/></td>
<td height="24" bgcolor="#F3F3F3">
  <a href="{$delete_url}">
    <img width="16" height="16" src="/image/b_drop.png" alt="删除" title="删除">
  </a>
</td>
</tr>
eot;
}
?>
</table>
<table width="60%" height="20" border="0" align="center">
<tr>
<td align="center"><input type="reset" name="Reset" value="重置" />
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="update" value="提交" /></td>
</tr>
</table>
</form>
</body>
</html>
